package 电影院;
import  java.util.LinkedList;

public class 座位表{
    private  int hang;
    private  int lie;
    int sum=0;
    int kong=0;
    int tuipiao=0;

    public int getSum() {
        return sum;
    }

    public void setSum(int sum) {
        this.sum = sum;
    }

    public int getKong() {
        return kong;
    }

    public void setKong(int kong) {
        this.kong = kong;
    }

    public int getTuipiao() {
        return tuipiao;
    }

    public void setTuipiao(int tuipiao) {
        this.tuipiao = tuipiao;
    }

    LinkedList<LinkedList<Integer>> list=new LinkedList<>();
    public 座位表(int hang, int lie) {
        this.hang = hang;
        this.lie = lie;
        this.sum=lie*hang;
        this.kong=sum;
        for (int i = 0; i < hang; i++) {
            LinkedList<Integer> row=new LinkedList<>();
            for (int j = 0; j < lie; j++) {
                row.add(i*10+j+1);
            }
            list.add(row);
        }
    }

    public 座位表() {
    }

    public int getHang() {
        return hang;
    }

    public void setHang(int hang) {
        this.hang = hang;
    }

    public int getLie() {
        return lie;
    }

    public void setLie(int lie) {
        this.lie = lie;
    }

    public void 打印(){
        System.out.println("总座位数为："+sum);
        System.out.println("空闲的座位数为："+kong);
        for (int i = 0; i <getHang(); i++) {
            System.out.println(list.get(i));
        }
    }

}
